<?php
/**
 * @description Hualong
 * @Author: 邹单
 * @CreateTime: 2015年12月16日
 */

namespace Home\Controller;
use Think\Controller;
use Think\Cache;

class HuaController extends Controller{

    public $cache;

    public function _initialize()
    {
        /* 读取站点配置 */
        $config = api('Config/lists');
        C($config); //添加配置

        if (!C('WEB_SITE_CLOSE')) {
            $this->error('站点已经关闭，请稍后访问~');
        }
        $this->cache = Cache::getInstance();
        //session('url',$this->action());
        $user = array(
            'nickname'  => '指尖上的光阴',
            'headimgurl'=> 'http://wx.qlogo.cn/mmopen/OLzPevKRMunm25X4syCuw6KjhWWNibLqHQEeBlHpFg0KHnicdhUrwZseqecXDpricslzxISqk4NUS1YlvfLgTibp4kw6DRficVq3v/0',
            'openid'    => 'o6F-qjt2mquGrfwjNamgkSo4-_qI',
        );

        M('lord_user')->where(array('lord_id'=>1))->setInc('scan_num',1);
        $_SESSION['wx_user'] = $user; //本地测试开启
        if (!$_SESSION['wx_user']) {
            $url = "http://wxin2.cqnews.net/authorize.aspx?gp=e11172bd023040fbb2b830c103aa4f3d&ga=9ad0408453e547f2ad01ba74389d607d";
            redirect($url);
        }
    }
}


